class Node(object):
    def __init__(self, data=None):
        self.data = data
        self.next = None


class ChainTable(object):
    def __init__(self):
        self.head = None

    def isEmpty(self):
        if self.head is None:
            return None

    def clear(self):
        self.head = None

    def insert(self, pos, data):
        count = -2
        pre_node = self.head
        cur_node = self.head.next
        while cur_node.next is not None:
            if count == pos:
                pre_node.next = data
                data.next = cur_node
                return
            else:
                count += 1
                pre_node = cur_node
                cur_node = cur_node.next

    def append(self, data):
        print("4")
        if self.head is None:
            self.head = data

            return data
        print(data)
        cur_node = self.head
        while cur_node.next is not None:
            cur_node = cur_node.next
        cur_node.next = data
        return data

    def delete(self, pos):
        if self.head is None:
            return None
        count = -2
        pre_node = self.head
        cur_node = self.head.next
        while cur_node.next is not None:
            if count == pos:
                p = cur_node
                pre_node.next = cur_node.next
                del p
                return
            else:
                count += 1
                pre_node = cur_node
                cur_node = cur_node.next


ls = ChainTable()

if __name__ == '__main__':
    # stu0 = Student(name='0')
    # node = Node(data=stu0)
    # ls.append(node)
    # for i in range(3):
    #     stu = Student(name=str(i + 1))
    #     node = Node(data=stu)
    #     ls.append(node)

    node = Node('zhangsan')
    ls.append(node)